<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>紫色鹭</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/submission_proves.css"/>
    <style>
        .layui-upload{
            background: none;
        }
    </style>
</head>
<body>
<div id="header_01_html">
    <iframe id="header_01" src="head_01.html" frameborder="0"></iframe>
</div>
<div id="head_search_html">
    <iframe id="head_search" src="head_search.html" frameborder="0"></iframe>
</div>
<div class="container store_info clearfix">
    <div class="store_tab">
        <a mhref="store_info.html" class="store-info">基本信息</a>
        <a mhref="store_banner.html" class="store_banner has_store banner-admmin" v-show="storeId!=false?true:false">轮播管理</a>
        <a mhref="store_product.html" class="has_store product-admin">商品管理</a>
        <a mhref="store_manage.html" class="has_store order-admin">订单管理</a>
        <a class="active has_store">企业认证</a>
        <!--<a mhref="store_evaluate.html" class="has_store evaluate-admin">评价管理</a>-->
    </div>
    <div class="right">
        <div class="title">认证详情</div>
        <div class="vue-box">


            <div class="layui-form" style="padding-bottom: 50px;">
                <div class="sun_inputs">
                    <div class="inputs_left">
                        <span class="c_red"></span>
                        <span>企业名称:</span>
                    </div>
                    <div class="inputs_right">
                        <input readonly type="text" name="" v-model="name" class="sub_name layui-input"/>
                    </div>
                </div>
                <div class="sun_inputs">
                    <div class="inputs_left">
                        <span class="c_red"></span>
                        <span>联系人:</span>
                    </div>
                    <div class="inputs_right">
                        <input readonly type="text" name="" v-model="contacts" class="sub_name  layui-input"/>
                    </div>
                </div>
                <div class="sun_inputs">
                    <div class="inputs_left">
                        <span class="c_red"></span>
                        <span>电话:</span>
                    </div>
                    <div class="inputs_right">
                        <input readonly type="text" name="" id="" v-model="mobile" class="sub_name  layui-input"/>
                    </div>
                </div>
                <div class="sun_inputs">
                    <div class="inputs_left">
                        <span class="c_red"></span>
                        <span>手机号:</span>
                    </div>
                    <div class="inputs_right">
                        <input readonly type="text" name="" v-model="phone" class="sub_name  layui-input"/>
                    </div>
                </div>
                <div class="sun_inputs">
                    <div class="inputs_left">
                        <span class="c_red"></span>
                        <span>邮箱:</span>
                    </div>
                    <div class="inputs_right">
                        <input readonly type="text" name="" v-model="eMail" class="sub_name  layui-input"/>
                    </div>
                </div>
                <div class="sun_inputs">
                    <div class="inputs_left">
                        <span class="c_red"></span>
                        <span>门店地址:</span>
                    </div>
                    <div class="inputs_right">
                        <input readonly type="text" class="sub_name layui-input" v-model="addressDetail"/>
                    </div>
                </div>
                <div class="sun_inputs">
                    <div class="inputs_left">
                        <span class="c_red"></span>
                        <span>门店照片:</span>
                    </div>
                    <div class="inputs_right">
                        <div class="sub_photo store_photo">
                            <ul>
                                <li>
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn upload_btn"></button>
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn upload_btn"></button>
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img">
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn upload_btn"></button>
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img">
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="sun_inputs">
                    <div class="inputs_left">
                        <span class="c_red"></span>
                        <span>营业执照:</span>
                    </div>
                    <div class="inputs_right">
                        <div class="sub_photo yinye_phote" style="">
                            <div class="icbc_zhu">工商注册号：</div>
                            <input type="text" readonly class="icbc_input layui-input" v-model="businessLicenseNo"/>
                            <ul>
                                <li style="margin-left:0;margin-top:20px;">
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn upload_btn" id="businessLicensePicUrl"></button>
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img">
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="sun_inputs" v-if="type == 3">
                    <div class="inputs_left">
                        <span class="c_red">*</span>
                        <span>企业人数:</span>
                    </div>
                    <div class="inputs_right">
                        <input type="text" class="sub_name  layui-input" v-model="num"/>
                    </div>
                </div>
                <div class="sun_inputs" v-if="type  == 3">
                    <div class="inputs_left">
                        <span class="c_red">*</span>
                        <span>主修车型:</span>
                    </div>
                    <div class="inputs_right">
                        <input type="text" class="sub_name layui-input" v-model="majorModel"/>
                    </div>
                </div>
                <div class="sun_inputs" v-if="type  == 3">
                    <div class="inputs_left">
                        <span class="c_red">*</span>
                        <span>服务项目:</span>
                    </div>
                    <div class="inputs_right">
                        <input type="text" class="sub_name layui-input" v-model="serviceName"/>
                    </div>
                </div>
                <!--<div class="sun_inputs">-->
                    <!--<div class="inputs_left">-->

                    <!--</div>-->
                    <!--<div class="inputs_right">-->
                        <!--<div class="layui-btn" @click="toSubmit">确认提交</div>-->
                    <!--</div>-->
                <!--</div>-->

            </div>



        </div>
    </div>
</div>
<div class="tabRight">
    <div class="first">
        <ul>
            <li><a target="_blank" class="icon_admin_white" title=""></a></li>
            <li>
                <a target="_blank" class="go-shopcard c-fff">
                    <i class="icon_shopcar_white"></i>
                    <p class="mt10">购<br>物<br>车</p>
                    <span class="car-num pos-Sty1">0</span>
                </a>
            </li>
            <li>
                <a target="_blank" class="icon_list_white mt10 go-myorder" title="订单"></a>
                <a target="_blank" class="icon_collect_white mt10 go-myhas" title="收藏"></a>
                <a target="_blank" class="icon_history_white mt10 go-record" title="记录"></a>
            </li>
        </ul>
    </div>
    <div class="second">
        <a target="_blank" class="icon_edit_white"></a>
        <a target="_blank" class="icon_top_white mt10"></a>
    </div>
</div>
</body>
<script src="../js/config.js"></script>
<script>
    initAreaSelect();
    var app = new Vue({
        el: '.vue-box',
        data: {
            type: getUrlParam("type"),
            name: "",
            contacts: "",
            mobile: "",
            phone: "",
            eMail: "",
            provinceId: "",
            cityId: "",
            districtId: "",
            addressDetail: "",
            businessLicenseNo: "",
            num: "",
            majorModel: "",
            serviceName: "",
        },
        beforeCreate: function () {
            var that = this;
                get_ajax("/sys/authentication/myAuthentication", {}, function (data) {
                    var payCertificateUrl = data.payCertificateUrl.split(",");
                    that.name = data.name;
                    that.contacts = data.contacts;
                    that.mobile = data.mobile;
                    that.phone = data.phone;
                    that.eMail = data.eMail;
                    that.address = data.address;

                    that.addressDetail = data.province+data.city+data.district+data.address;
                    that.businessLicenseNo = data.businessLicenseNo;
                    that.num = data.num;
                    that.majorModel = data.majorModel;
                    that.serviceName = data.serviceName;
                    payCertificateUrl.forEach(function (item,index) {
                        $(".store_photo .upload_btn").eq(index).attr("picUrl",item);
                        $(".store_photo .layui-upload-img").eq(index).attr("src",imgBaseUrl+item);
                    })
                    $("#businessLicensePicUrl").attr("picUrl",data.businessLicensePicUrl);
                    $(".yinye_phote .layui-upload-img").attr("src",imgBaseUrl+data.businessLicensePicUrl);
                    initLayuiArea(data.provinceId,data.cityId,data.districtId)
                })
        },
        updated: function () {

        },
        methods: {
//            toSubmit: function () {
//                console.log($("#province").val())
//                var businessLicensePicUrl = $("#businessLicensePicUrl").attr("picUrl");
//                var payCertificateUrl = [];
//                $(".store_photo .upload_btn").each(function () {
//                    var picUrl = $(this).attr("picUrl");
//                    if (picUrl) {
//                        payCertificateUrl.push(picUrl);
//                    }
//                })
//                var sendData = {
//                    name: this.name,
//                    contacts: this.contacts,
//                    type: this.type,
//                    mobile: this.mobile,
//                    phone: this.phone,
//                    eMail: this.eMail,
//                    provinceId: $("#province").val(),
//                    cityId: $("#city").val(),
//                    districtId: $("#area").val(),
//                    businessLicenseNo: this.businessLicenseNo,
//                    businessLicensePicUrl: businessLicensePicUrl,
//                    payCertificateUrl: payCertificateUrl.toString(),
//                    address:this.address
//                };
//                if (this.type == 3) {
//                    $.extend(sendData, {
//                        num: this.num,
//                        majorModel: this.majorModel,
//                        serviceName: this.serviceName,
//                    })
//                }
//                for (item in sendData) {
//                    if (!sendData[item]) {
//                        layer.msg("请完善表单数据！");
//                        return
//                    }
//                }
//                if (!phone_rexg.test(this.phone)) {
//                    layer.msg("请输入正确的手机号!");
//                    return
//                }
//                if (!payCertificateUrl) {
//                    layer.msg("请上传门店照片!");
//                    return
//                }
//                if (!businessLicensePicUrl) {
//                    layer.msg("请上传营业执照!");
//                    return
//                }
//                get_ajax("/sys/authentication/saveAuthentication", sendData, function (data) {
//                    layer.confirm('提交成功!', {
//                            btn: ['确定', '取消']
//                        }, function (index, layero) {
//                            goIndex();
//                        }
//                    );
//                })
//            }
        }
    })
//    //图片上传
//    layui.use(['upload','form'], function () {
//        var $ = layui.jquery, upload = layui.upload;
//        var form = layui.form;
//        form.render();
//        //普通图片上传
//        var uploadInst = upload.render({
//            elem: '.upload_btn'
//            , url: baseUrl + '/file/upload?token=' + Token
//            , before: function (obj) {
//
//            }
//            , done: function (res, index) {
//                //如果上传失败
//                if (res.code > 0) {
//                    return layer.msg.msg('上传失败');
//                } else {
//                    var data = res.data;
//                    this.item.attr("picUrl", data.address);
//                    this.item.attr("picId", data.id);
//                    this.item.siblings(".layui-upload-list").find("img").attr('src', imgBaseUrl + data.address);
//                }
//
//            }
//            , error: function () {
//
//            }
//        });
//    })

</script>
</html>